﻿namespace GuiaTest
{
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Linq;
    using System.Text;
    using System.Threading;
    using Guia.Config;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// Summary description for AppConfigImplTest
    /// </summary>
    [TestClass]
    public class AppConfigImplTest : AbstractTest
    {
        private static IConfig config = AppConfigImpl.Instance;

        [TestMethod]
        public void TestElementTimeout()
        {
            Assert.AreEqual(1500, config.ElementTimeout);
        }

        [TestMethod]
        public void TestWindowTimeout()
        {
            Assert.AreEqual(15000, config.WindowTimeout);
        }

        [TestMethod]
        public void TestCloseModalWindowsTimeout()
        {
            Assert.AreEqual(5000, config.CloseModalWindowsTimeout);
        }

        [TestMethod]
        public void TestGetOpenFileDefaultTitleGerman()
        {
            string localString = config.GetLocalizedName(EElementIdentifier.OPEN_FILE_DEFAULT_TITLE);
            Assert.AreEqual("Öffnen", localString);
        }

        [TestMethod]
        public void TestGetOpenFileDefaultTitleEnglish()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-GB");
            Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
            string localString = config.GetLocalizedName(EElementIdentifier.OPEN_FILE_DEFAULT_TITLE);
            Assert.AreEqual("Open", localString);
        }
    }
}
